Server.ino

					
#include "Server.h"

void handlePOST(void)
{
  //server.send(200, "text/plain", "Post Request Received on ESP-01!");
  
  Serial.println("POST request received");
  if(server.hasArg("input_bool_1") && server.hasArg("input_bool_2") && server.hasArg("input_bool_3") && server.hasArg("input_bool_4") && server.hasArg("input_bool_5"))
  {
     //Serial.println("Packets seem to be all right");
  }
  else
    {
      //Serial.println("Fields are not Correct");
      server.send(204, "text/plain", "Fields are not Correct");
    }

  //server.sendHeader("Location", "https://ampel101.000webhostapp.com/control2.php",true); //Redirect to our html web page 
  server.sendHeader("Location", "http://ampel101.000webhostapp.com/control2.php",true); //Redirect to our html web page 
  server.send(303, "text/plain","");

  String Received_data = "";

  Received_data = "rcwd" + (String)server.arg("input_bool_1") + (String)server.arg("input_bool_2") + (String)server.arg("input_bool_3") + (String)server.arg("input_bool_4") + (String)server.arg("input_bool_5");
  
  Serial.println(Received_data);
}

void handleEMPTY(void)
{
  server.send(200, "text/html", "HELLO FROM ESP-01");
}